﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$ArticleDBConnection$" formatter="bizobjlist of RssFeed(rootArticle(primaryPicture))">

	<Sql>
    SELECT   
      r.id
      ,r.companyId
      ,r.includePodCastAttribs
      ,r.useBodyAsDescription
      ,r.useLastUpdateAsFeedDate
      ,r.entireTree, r.leafNodes
      ,r.articleId as rootArticleid
      ,a.uniqueTitle as rootArticleuniqueTitle
      ,a.baseTitle as rootArticlebaseTitle
      ,a.translatedTitles as rootArticletranslatedTitles
      ,a.summary AS rootArticlebaseSummary
      ,a.translatedSummaries as rootArticletranslatedSummaries
      ,a.id AS primaryPictureId
      ,a.primaryMediaName AS primaryPictureName
    FROM
      CompanyRssFeeds AS r
      LEFT OUTER JOIN	Articles AS a ON r.articleId = a.id
    WHERE
      r.companyId = @companyId
  </Sql>
	<Param name="companyId" type="UniqueIdentifier" />
</AdoNetDataAccess>
